//  This file is part of Swordbible - http://www.swordwarrior.net
//  Copyright (C) 2003-2009 Manu Mital mital.manu@gmail.com

//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2, or (at your option)
//  any later version.

//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.

//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software Foundation,
//  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

// MainFrm.h : interface of the CMainFrame class
//



#pragma once

#include "Devotional.h"
#include "VerseLists.h"
#include "Hangman.h"
#include "toolbar/TCToolBar.h"
#include "BaseDialog.h"
#include "BaseTreeDialog.h"


////////////////////////////////////////////////////////////


class CMainFrame : public CFrameWnd
{
	
protected: // create from serialization only
	CMainFrame();
	DECLARE_DYNCREATE(CMainFrame)


// Attributes
public:
  CBaseDialog     m_bibleDlg;
  CBaseDialog     m_comDlg;
  CBaseDialog     m_dictDlg;
  CBaseTreeDialog m_treeDlg;

private:
	CDevotional * m_pModeless;
	BOOL m_bPreview;  // TRUE in print preview mode; FALSE otherwise
	
public:
	 	static CVerseLists    * m_pModelessVL;  // static so that search class can access this
   CFont *  pFont;

// Overrides
public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	void Normal() { OnNormal(); }

// Implementation
public:
	virtual ~CMainFrame();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:  // control bar embedded members
	CStatusBar  m_wndStatusBar;
	CTCToolBar    m_wndToolBar;
	 
public:
	CTCToolBar   m_wndQuickVerseBar;
	CComboBox QuickVerseCombo;


// Generated message map functions
protected:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnTopMax();
	afx_msg void OnBottomMax();
	afx_msg void OnNormal();
	afx_msg void OnSubMenuBookMarks(UINT nID);
	afx_msg LRESULT OnShowDevotional(WPARAM wParam, LPARAM lParam);

	DECLARE_MESSAGE_MAP()
public:

  afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnDeleteBookmark();
	afx_msg void OnAddBookmark();
	afx_msg void OnMenuBiblepageSearch();
	afx_msg void OnBottomSearch();
	afx_msg void OnMainDisplay();
	afx_msg void OnBottomDisplay();
	// load the bookmarks from the registry into the mainframe  menu
	void LoadBookmarks(void);

	afx_msg void OnViewDevotional();
	afx_msg void OnVerseLists();
  afx_msg void OnScriptureChallenge();
	afx_msg void OnWeb();
	afx_msg void OnInstallMgr();
	afx_msg void OnPrayerrequest();
  afx_msg void OnHelp();


	afx_msg void OnLemma();
	afx_msg void OnUpdateLemma(CCmdUI * pCmdUI);

	afx_msg void OnMorph();
	afx_msg void OnUpdateMorph(CCmdUI * pCmdUI);
	
	afx_msg void OnFootnotes();
	afx_msg void OnUpdateFootnotes(CCmdUI *pCmdUI);
	
	afx_msg void OnCrossref();
	afx_msg void OnUpdateCrossref(CCmdUI *pCmdUI);

	afx_msg void OnHeading();
	afx_msg void OnUpdateHeading(CCmdUI *pCmdUI);

	afx_msg void OnRed();
	afx_msg void OnUpdateRed(CCmdUI *pCmdUI);

  afx_msg void OnCrossLinksManager();

  BOOL OnToolTipNotify(UINT id, NMHDR *pNMHDR,   LRESULT *pResult);

	afx_msg void OnDestroy();
	afx_msg void OnMainBiblePrint();
	afx_msg void OnMainBibleCopy();
	afx_msg void OnMainBibleSelectall();
	afx_msg void OnBiblepageCopymanager();
 // afx_msg void OnMainBibleRTL();
//  afx_msg void OnUpdateBibleRTL(CCmdUI *pCmdUI);
	afx_msg void OnMainBibleZoomtext();
	afx_msg void OnBibleSplitview();
	afx_msg void OnMainBiblePrevious();
	afx_msg void OnMainBibleNext();
  afx_msg void OnMainBibleInfo();
	afx_msg void OnUpdateBibleZoom(CCmdUI *pCmdUI);
	afx_msg void OnCommentaryCopy();
	afx_msg void OnMFCommentarySelectall();
	afx_msg void OnMFCommentaryZoomtext();
	afx_msg void OnMFUpdateCommentaryZoom(CCmdUI *pCmdUI);
	afx_msg void OnMFCommentaryPrevious();
	afx_msg void OnMFCommentaryNext();
  afx_msg void OnMFCommentaryInfo();
	afx_msg void OnMFCommentaryPrint();
	afx_msg void OnMFCommentarySynch();
	afx_msg void OnUpdateMFCommentarySynch(CCmdUI *pCmdUI);
	afx_msg void OnUpdateBibleSplitview(CCmdUI *pCmdUI);
	afx_msg void OnNotesPrevious();
	afx_msg void OnNotesNext();
	afx_msg void OnNotesSave();
	afx_msg void OnNotesPrint();
	afx_msg void OnNotesSynchronize();
  afx_msg void OnNotesInsertLink();
	afx_msg void OnNotesCut();
	afx_msg void OnNotesCopy();
	afx_msg void OnNotesPaste();
	afx_msg void OnNotesBold();
	afx_msg void OnUpdateNotesBold(CCmdUI *pCmdUI);
	afx_msg void OnNotesItalic();
	afx_msg void OnUpdateNotesItalic(CCmdUI *pCmdUI);
	afx_msg void OnUpdateNotesUnderline(CCmdUI *pCmdUI);
	afx_msg void OnNotesLeftalign();
	afx_msg void OnUpdateNotesLeftalign(CCmdUI *pCmdUI);
	afx_msg void OnNotesCenteralign();
	afx_msg void OnUpdateNotesCenteralign(CCmdUI *pCmdUI);
	afx_msg void OnNotesRightalign();
	afx_msg void OnUpdateNotesRightalign(CCmdUI *pCmdUI);
	afx_msg void OnNotesInsertbullets();
	afx_msg void OnUpdateNotesSynchronize(CCmdUI *pCmdUI);
	afx_msg void OnNotesUnderline();

	afx_msg void OnDictionaryPrint();
	afx_msg void OnDictionaryCopy();
	afx_msg void OnDictionarySelectall();
	afx_msg void OnBottomleftDisplay();
	afx_msg void OnDictionaryPrevious();
	afx_msg void OnDictionaryNext();
  afx_msg void OnDictionaryInfo();
	afx_msg void OnDictionaryZoomtext();
	afx_msg void OnUpdateDictionaryZoom(CCmdUI *pCmdUI);

	afx_msg void OnGenBooksPrint();
	afx_msg void OnGenBooksCopy();
	afx_msg void OnGenBooksSelectall();
	afx_msg void OnGenBooksDisplay();
	afx_msg void OnGenBooksPrevious();
	afx_msg void OnGenBooksNext();
  afx_msg void OnGenBooksInfo();
	afx_msg void OnGenBooksZoomtext();
	afx_msg void OnUpdateGenBooksZoom(CCmdUI *pCmdUI);

	afx_msg void OnOptionsRememberlast();
	afx_msg void OnUpdateRememberlast(CCmdUI *pCmdUI);
	afx_msg void OnOptionsDevotional();
	afx_msg void OnUpdateOptionsDevotional(CCmdUI *pCmdUI);
	afx_msg void OnClose();
	afx_msg void OnQuickVerseGo();
  afx_msg void OnQuickVerseDropDown();
	virtual void OnSetPreviewMode(BOOL bPreview, CPrintPreviewState* pState);
	virtual BOOL PreTranslateMessage(MSG* pMsg);

	BOOL GoToBibleVerse(CString& verse);
  void AddCurrentVerseToHistory();
	void SavePosition();
	void RestorePosition();

	void SaveQuickHistory();
	void LoadQuickHistory();

};


